home *** CD-ROM | disk | FTP | other *** search
- // First check to see if MONITOR.NLM is loaded. If so, reload MONITOR
- // with the -P option so we can access Processor Utilization details.
-
- IF LOADED MONITOR.NLM THEN UNLOAD MONITOR
-
- LOAD MONITOR -P
-
- // We need to check for success in loading MONITOR since the rest of
- // this batch job is useless without it.
-
- IF ERRORLEVEL THEN ABORT
-
-
- // Now check if the active console screen displayed is the "Monitor Screen".
- // (Note: The active screen name can be determined by pressing the Alt key
- // on the server console.) Since we loaded MONITOR then the active console
- // screen should be the "Monitor Screen". However, this test will insure
- // that the "Monitor Screen" is the active console screen, just in case.
-
- IF NOT CURRENT_SCREEN "Monitor Screen" THEN CHANGE_SCREEN "Monitor Screen"
-
-
- // Before we proceed much further, we want to make sure that any snapshots
- // we take are written to a specific directory. Therefore, we should set
- // the Current Working Directory (CWD) using the CD batch command. CD
- // can be used with a specific destination directory (e.g., SYS:\HOME\SUPER)
- // or a relative directory (e.g., ..\NEW_DIR). It is best to set the
- // initial CWD to a specific destination directory in order to assure the
- // validity of subsequent relative directory changes.
-
- DEFINE %0 %CWD% ; save the current CWD
-
- CD SYS:\HOME\SUPER ; set the initial CWD
-
-
- // At this point, we will assume that this batch file was initiated as
- // a result of a CPU utilization threshold alarm action by some network
- // management package. Ideally, we would like to isolate the cause of
- // the high utilization. To help in this quest, we will capture some
- // screen data from the MONITOR NLM for later reference.
-
- // The first step is to select the Processor Utilization option from
- // the main menu, use the F3 key to list all active processes, and scroll
- // through each page of active processes, capturing the screen data into
- // text files for later review. Hopefully, this will help us identify
- // which server process may be negatively impacting the server.
-
- KEYIN "Pro" ENTER ; Processor Utilization menu
-
- KEYIN F3 ; List all active processes
-
- WAIT 1 ; Give it time to collect data
-
- SAVE_SCREEN PROCUTIL.PG1 ; save text screen image in CWD
-
- KEYIN PGDN ; next page of active processes
-
- WAIT 1 ; Give it time to collect data
-
- SAVE_SCREEN PROCUTIL.PG2 ; save text screen image in CWD
-
- KEYIN PGDN ; next page of active processes
-
- WAIT 1 ; Give it time to collect data
-
- SAVE_SCREEN PROCUTIL.PG3 ; save text screen image in CWD
-
- KEYIN PGDN ; next page of active processes
-
- WAIT 1 ; Give it time to collect data
-
- SAVE_SCREEN PROCUTIL.PG4 ; save text screen image in CWD
-
- KEYIN ESC ; to Process Utilization menu
-
- KEYIN ESC ; to Main menu
-
-
- // Note: Specific processes can be review individually by specifying a
- // unique starting portion, or all, of the exact process name as follows:
-
- // KEYIN "Polling Proc" F5 ; for the Polling Process
- // KEYIN "Server 01 Pro" F5 ; for the Server 01 Process
- // KEYIN "Server 02 Pro" F5 ; for the Server 01 Process
- // KEYIN ENTER ; to show the selected processes
- // WAIT 1 ; Give it time to collect data
- // SAVE_SCREEN PROCUTIL.SEL ; save text screen image in CWD
-
-
- // The next step is to take a snapshot of the Resource Utilization info.
-
- KEYIN "Res" ENTER ; select Resource Utilization
-
- SAVE_SCREEN RESOURCE.PG1 ; save text screen image in CWD
-
- KEYIN ESC ; to Main menu
-
-
- // Hopefully, the list of active processes and resource usage will help
- // identify the source of the excessive CPU utilization. By returning
- // MONITOR to the Main menu, we have reduced its impact on the CPU.
- // However, to further minimize CPU load and maximize available Cache
- // Buffers, we should go ahead and unload MONITOR.
-
- UNLOAD MONITOR
-
- CD %0 ; restore the original CWD
-